<template>
	<div id="firstcomponent">
		<div class="click">
			<router-link :to="{ name: 'home' }">首页</router-link>
			<router-link :to="{ name: 'list'}">目录</router-link>
		</div>
		<div v-for="item in data">
			<p class="title">{{item.title}}</p>
			<div class="cont" v-html="item.cont"></div>
		</div>
	</div>
</template>


<script type="text/javascript">
		export default{
			data(){
				return{
					title:"11111",
					count:"789456789",
					prev:"",
					next:"",
					data:[]
				}
			},
			mounted(){},
			watch:{
				//'$route':'fetchData'
			},
			created(){
				this.$http.jsonp('http://localhost:3000/booklistshow?id='+this.$route.params.id+"&sid="+this.$route.params.sid).then(function(response) {
							      // 这里是处理正确的回调
							        this.data = response.data
							        console.log("请求成功");
							        // this.articles = response.data["subjects"] 也可以

							    }, function(response) {
							        // 这里是处理错误的回调
							        console.log("请求失败");
							    })
	        },
			methods: {}
		}
</script>

<style type="text/css">
	.title{font-style: 16px;text-align: center;}
	.cont{padding: 10px;font-style: 12px;text-align: left;max-width: 1000px;margin: auto;}
	.click{text-align: center;}
	.click a{margin: 0px 10px;}
</style>